/*
 * @Description: 选择地点页面
 * @Author: buwei.huang
 * @Date: 2019-07-12 11:07:30
 * @Last Modified by: ziwei.ma
 * @Last Modified time: 2019-10-30 16:25:06
 */

<template>
  <div id="app">
    <!-- 头部搜索 -->
    <head-search></head-search>
    <div class="chooseSite_wrap">
      <!-- 按钮icon -->
      <btn-icon :routeType="routeType" />
      <!-- 位置列表 -->
      <search-site-list :routeType="routeType" />
    </div>
  </div>
</template>

<script>
import { getUrlParamByKey } from 'vue-xiaobu-utils'
import HeadSearch from './components/HeadSearch'
import BtnIcon from './components/BtnIcon'
import SearchSiteList from './components/SearchSiteList'

export default {
  name: 'chooseSite',
  components: {
    'head-search': HeadSearch,
    'btn-icon': BtnIcon,
    'search-site-list': SearchSiteList
  },
  data() {
    return {
      routeType: '',
      isShow: false
    }
  },
  mounted() {
    // 获取路由  区分跳转
    let routeType = getUrlParamByKey('ROUTETYPE')
    if (routeType) {
      this.routeType = this._disposeRoute(routeType)
    }
  },
  methods: {
    // 处理路由
    _disposeRoute(url) {
      if (url.indexOf('?') > 0) {
        // url包含?则后面添加&
        url += '&'
      } else {
        url += '?'
      }
      return url
    }
  }
}
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
/* 修复css边距合并带来的问题 */
body {
  position: absolute;
  width: 100%;
}
#app {
  height: 100%;
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
.chooseSite_wrap {
  background-color: #f2f5f6;
}
</style>
